package com.molichuxing.services.infrastructure.dao;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.services.infrastructure.bean.LawsuitBean;
import com.molichuxing.services.infrastructure.dto.response.LawsuitListDto;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

public interface LawsuitMapper extends RootMapper<LawsuitBean> {

    /**
     * 完成诉讼
     *
     * @param orderCode   订单号
     * @param finishState 完成状态
     * @param finishTime  完成时间
     * @return
     */
    int modifyComplete(@Param("orderCode") Long orderCode,
                       @Param("finishState") int finishState, @Param("finishTime") LocalDateTime finishTime);

    /**
     * 根据订单号查询诉讼信息
     *
     * @param orderCode 订单号
     * @return
     */
    LawsuitBean getLawsuitByOrderCode(@Param("orderCode") Long orderCode);

    /**
     * 查询诉讼数量
     *
     * @return
     */
    long getLawsuitTotal();

    /**
     * 根据条件分页查询
     *
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<LawsuitListDto> getPaged(@Param("params") Map<String, Object> params,
                                  @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    /**
     * 根据条件分页查询count
     *
     * @param params
     * @return
     */
    long getPagedCount(@Param("params") Map<String, Object> params);
}